package com.CMS.server.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = EntityTokens.IMAGE_TABLE)
public class Images extends BaseEntity{

	private static final long serialVersionUID = 1969505968790308634L;
	
	@ManyToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	protected Galery galery;
	
	@ManyToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	protected Page page;
	
	@Column(name = EntityTokens.IMAGE_NAME, length = EntityTokens.IMAGE_NAME_LENGTH,
			nullable = EntityTokens.IMAGE_NAME_NULLABLE)
	protected String name;
	
	@Column(name = EntityTokens.IMAGE_VISIBLE, length = EntityTokens.IMAGE_VISIBLE_LENGTH,
			nullable = EntityTokens.IMAGE_VISIBLE_NULLABLE)
	protected int visibile;
	
	public Images(){
		super();
	}


	public Galery getGalery() {
		return galery;
	}


	public void setGalery(Galery galery) {
		this.galery = galery;
	}


	public Page getPage() {
		return page;
	}


	public void setPage(Page page) {
		this.page = page;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}
	
	public int getVisible()
	{
		return this.visibile;
	}
	
	public void setVisible(int state)
	{
		this.visibile=state;
	}
	

	 
}
